<!DOCTYPE html>
<html lang="en-GB">

<head>
    <title>XHR Failure</title>
    <meta charset="utf-8" />
    <script src="/docs/node_modules/@bugsnag/browser/dist/bugsnag.min.js"></script>
    <script>
        var NOTIFY = decodeURIComponent(window.location.search.match(/NOTIFY=([^&]+)/)[1])
        var SESSIONS = decodeURIComponent(window.location.search.match(/SESSIONS=([^&]+)/)[1])
        var API_KEY = decodeURIComponent(window.location.search.match(/API_KEY=([^&]+)/)[1])

        Bugsnag.start({
            apiKey: API_KEY,
            endpoints: { notify: NOTIFY, sessions: SESSIONS },
        })

        function notify () {
            Bugsnag.notify(new Error("This error should have network breadcrumbs attached"))
        }

        var xhr = new XMLHttpRequest()
        xhr.onloadend = notify
        xhr.onerror = notify
        xhr.open("GET", "i_dont_exist.html")
        xhr.send()

    </script>
</head>

<body>
</body>

</html>
